#ifndef _MCacheFormatDescription
#define _MCacheFormatDescription
//-
// ==========================================================================
// Copyright (C) 1995 - 2010 Autodesk, Inc., and/or its licensors.  All
// rights reserved.
//
// The coded instructions, statements, computer programs, and/or related
// material (collectively the "Data") in these files contain unpublished
// information proprietary to Autodesk, Inc. ("Autodesk") and/or its
// licensors,  which is protected by U.S. and Canadian federal copyright law
// and by international treaties.
//
// The Data may not be disclosed or distributed to third parties or be
// copied or duplicated, in whole or in part, without the prior written
// consent of Autodesk.
//
// The copyright notices in the Software and this entire statement,
// including the above license grant, this restriction and the following
// disclaimer, must be included in all copies of the Software, in whole
// or in part, and all derivative works of the Software, unless such copies
// or derivative works are solely in the form of machine-executable object
// code generated by a source language processor.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
// AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED
// WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF
// NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE,
// OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO
// EVENT WILL AUTODESK AND/OR ITS LICENSORS BE LIABLE FOR ANY LOST
// REVENUES, DATA, OR PROFITS, OR SPECIAL, DIRECT, INDIRECT, OR
// CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS LICENSORS HAS
// BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES.
// ==========================================================================
//+
//
// CLASS:    MCacheFormatDescription
//
// ****************************************************************************

#if defined __cplusplus

// ****************************************************************************
// INCLUDED HEADER FILES


#include <maya/MString.h>
#include <maya/MTime.h>

// ****************************************************************************
// CLASS DECLARATION (MCacheFormatDescription)

//! \ingroup OpenMaya
//! \brief Cache format description. 
/*!
  The MCacheFormatDescription is a utility class used by MPxCacheFormat when
  implementing custom cache plug-ins that define their own handling of 
  the cache format (usually provided by Maya's own xml format).
*/
class OPENMAYA_EXPORT MCacheFormatDescription
{
public:
	//! Cache file distribution types.
	typedef enum {
		kNoFile,			//!< just memory cache
        kOneFile,			//!< one file for all frames
		kOneFilePerFrame	//!< one file per frame
    } CacheFileDistribution;        

	//! Cache file data types.
	typedef enum {
		kUnknownData,		//!< unknown data
		kDouble,			//!< a single double value
		kDoubleArray,		//!< an array of double values
		kDoubleVectorArray,	//!< an array of double vector values
		kInt32Array,		//!< an array of int32 values
		kFloatArray,		//!< an array of float values
		kFloatVectorArray	//!< an array of float vector values
	} CacheDataType;

	//! Cache file sampling types.
    typedef enum {
		kRegular,			//!< regular sampling
        kIrregular			//!< irregular sampling
    } CacheSamplingType;

	//! Set up the cache format when reading the description file.
	void				setDistribution( CacheFileDistribution distribution );
	void				setTimePerFrame( const MTime& timePerFrame );
	void				addDescriptionInfo( const MString& info );
	unsigned int		addChannel( const MString& channelName,
									const MString& interpretation,
									CacheDataType dataType,
									CacheSamplingType samplingType,
									const MTime& samplingRate,
									const MTime& startTime,
									const MTime& endTime,
									MStatus* status=NULL );

	//! Get information about the format in order to write the description file.
	CacheFileDistribution	getDistribution() const;
	MTime					getTimePerFrame() const;
	void					getStartAndEndTimes( MTime& startTime, MTime& endTime ) const;
BEGIN_NO_SCRIPT_SUPPORT:
	//! \noscript
	void					getDescriptionInfo( MStringArray& info ) const;
END_NO_SCRIPT_SUPPORT:
	MStringArray			getDescriptionInfo() const;
	unsigned int			getNumChannels() const;
	MString					getChannelName( unsigned int channelIndex ) const;
	MString					getChannelInterpretation( unsigned int channelIndex ) const;
	CacheDataType			getChannelDataType( unsigned int channelIndex ) const;
	CacheSamplingType		getChannelSamplingType( unsigned int channelIndex ) const;
	MTime					getChannelSamplingRate( unsigned int channelIndex ) const;
	MTime					getChannelStartTime( unsigned int channelIndex ) const;
	MTime					getChannelEndTime( unsigned int channelIndex ) const;

	static const char* className();

private:
	// This class should never be instantiated directly.
	MCacheFormatDescription();
	virtual ~MCacheFormatDescription();

	void *		fData;
};

#endif /* __cplusplus */
#endif /* _MCacheFormatDescription */
